<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="../lib/vue.min.js"></script>
    <style>
        .actived{background:red;}
    </style>
    <title>demo</title>
</head>
<body>
    <div id="demo">
        <input type="text" v-model="ok">
        <span v-show="ok">Hello!</span>
        <h2 v-bind:class="{'actived':active}" @click="toggole()">hahah </h2>
    </div>
    
</body>
<script>
    vm = new Vue ({
        el: "#demo",
        data: {
            message :"hello world",
            ok:false,
            active:true
        },
        methods:{
            toggole:function(){
                vm.active = !vm.active;
            }
        }
    });
</script>
</html>